/*
 * @Author: laladuduqq
 * @Date: 2024-12-17 19:48:10
 * @LastEditors: laladuduqq
 * @LastEditTime: 2024-12-25 00:11:23
 */
#ifndef __CAN_COMMON_H
#define __CAN_COMMON_H
#ifdef __cplusplus
extern "C"{
#endif

#include <rtthread.h>
#include <rtdevice.h>

extern rt_device_t can1_bus;            /* CAN 设备句柄 */
extern rt_device_t can2_bus;

typedef struct 
{
    rt_device_t *can_handle; // can句柄
    struct rt_can_msg txmsg;    // CAN报文发送配置
} CanMessage;


/* CAN实例初始化结构体,将此结构体指针传入注册函数 */
typedef struct
{
    rt_device_t *can_handle;              // can句柄
    uint32_t tx_id;                             // 发送id
    uint32_t rx_id;                             // 接收id
} CanMessage_Init_s;




#ifdef __cplusplus
}
#endif

#endif // CAN_COMMON_H